package org.lark.model.dto;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import org.gts.webtools.BatchNoUtil;

import java.io.Serializable;

@Data
public class BatchRequest<T> implements Serializable {

    private static final long serialVersionUID = -226361578984377377L;

    private T data;

    @JSONField(name = "batch_no")
    private String batchNo;

    public BatchRequest() {
        this.batchNo = BatchNoUtil.get();
    }

    public BatchRequest(String batchNo) {
        this.batchNo = batchNo;
    }

    public BatchRequest(T data) {
        this.batchNo = BatchNoUtil.get();
        this.data = data;
    }

    public BatchRequest(String batchNo, T data) {
        this.batchNo = batchNo;
        this.data = data;
    }
}